package com.bdqn.service.impl;

import com.bdqn.mapper.StorageMapper;
import com.bdqn.pojo.Storage;
import com.bdqn.service.StorageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

@Transactional
@Service("StorageService")
public class StorageServiceImpl implements StorageService {
    @Autowired
    private StorageMapper storageMapper;
    @Transactional(propagation = Propagation.REQUIRED)
    @Override
    public int addStorage(Storage storage) {
        return storageMapper.addStorage(storage);
    }
    @Transactional(propagation = Propagation.REQUIRED)
    @Override
    public int deleteStorage(Long id) {
        return storageMapper.deleteStorage(id);
    }
    @Transactional(propagation = Propagation.REQUIRED)
    @Override
    public int updateStorage(Storage storage) {
        return storageMapper.updateStorage(storage);
    }
}
